﻿using LJX.SmartPark.Common.ResponseOutput;
using LJX.SmartPark.Domain.IotInfo.SmartLamp;
using LJX.SmartPark.Service.IotInfo.SmartLamp;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using static LJX.SmartPark.Service.IotInfo.SmartLamp.SmartLampService;
using static LJX.SmartPark.Service.IotInfo.SmartLamp.StatusLogsService;

namespace LJX.SmartPark.WebApi.Controllers.IotInfo
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [ApiExplorerSettings(GroupName = "IotInfo")]
    public class StatusLogsController : ControllerBase
    {
        private readonly IStatusLogsService _StatusLogsService;
        public StatusLogsController(IStatusLogsService StatusLogsServicee)
        {
            _StatusLogsService = StatusLogsServicee;
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<Response<bool>> PostAddStatusLogs(StatusLogs input)
        {
            var result = _StatusLogsService.StatusLogsAdd(input);
            return result;
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpDelete]
        public Task<Response<bool>> DeleteStatusLogs(StatusLogs input)
        {
            var result = _StatusLogsService.StatusLogsDelete(input);
            return result;
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPut]
        public Task<Response<bool>> PutUpdateStatusLogs(StatusLogs input)
        {
            var result = _StatusLogsService.StatusLogsUpdate(input);

            return result;

        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        public Response<List<StatusLogs>> GetSmartStatusLogs()
        {
            var result = _StatusLogsService.GetStatusLogsAsync();
            return result.Result;
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public Response<StatusLogs> GetStatusLogsById(StatusLogs input)
        {
            var student = _StatusLogsService.GetStatusLogsData(input);
            return student;
        }

        /// <summary>
        /// 分页显示查询
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [HttpPost]
        public Response<List<StatusLogs>> GetStatusLogsPage(GetSelectLogData select)
        {
            var result = _StatusLogsService.GetStatusLogsPage(select);
            return result.Result;
        }
        /// <summary>
        /// 获取总条数
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [HttpGet]
        public int GetCount()
        {
            return _StatusLogsService.GetCount();
        }

    }
}
